package me.jessyan.armscomponent.app.mvp.ui.holder;

import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.jess.arms.base.BaseHolder;
import com.jess.arms.utils.ArmsUtils;

import butterknife.BindView;
import me.jessyan.armscomponent.app.R;
import me.jessyan.armscomponent.app.mvp.ui.activity.ChannelActivity;
import me.jessyan.armscomponent.app.mvp.ui.model.LeftListBean;
import me.jessyan.armscomponent.app.mvp.ui.model.RightListBean;

public class RightListHolder extends BaseHolder<RightListBean> {
    @BindView(R.id.iv_icon)
    ImageView mIcon;
    @BindView(R.id.tv_title)
    TextView mTitle;
    @BindView(R.id.tv_subtitle)
    TextView mSubTitle;


    public RightListHolder(View itemView) {
        super(itemView);
    }

    @Override
    public void setData(@NonNull RightListBean rightListBean, int i) {
        if(rightListBean == null){
            return;
        }
        mIcon.setImageResource(rightListBean.getResource());
        mTitle.setText(rightListBean.getName());
        mSubTitle.setText(rightListBean.getChannel());
        itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ArmsUtils.startActivity(ChannelActivity.class);
            }
        });
    }

    @Override
    protected void onRelease() {
//        mImageLoader.clear(mAppComponent.application(), CommonImageConfigImpl.builder()
//                .imageViews(mAvatar)
//                .build());
    }


}
